﻿using System.IO;

namespace ImageCompare.Core
{
    public class PublicMethod
    {
        public static System.Collections.Generic.List<FileInfo> GetPicFiles(string filePath)
        {
            DirectoryInfo di = new DirectoryInfo(filePath);
            FileInfo[] files = di.GetFiles();
            string fileName;
            System.Collections.Generic.List<FileInfo> list = new System.Collections.Generic.List<FileInfo>();
            for (int i = 0; i < files.Length; i++)
            {
                fileName = files[i].Name.ToLower();
                if (fileName.EndsWith(".bmp") || fileName.EndsWith(".jpg") || fileName.EndsWith(".jpeg") || fileName.EndsWith(".png"))
                {
                    list.Add(files[i]);
                }
            }
            return list;
        }
    }
}
